package com.unbank.index;

import org.elasticsearch.client.Client;
import static org.elasticsearch.node.NodeBuilder.*;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.node.Node;

import com.unbank.values.SysParameters;

public class IndexClientFactory {
private static Client client;
	
	private IndexClientFactory(){}
	
	public static Client getClient(){
		Node node = nodeBuilder().node();
		Client client = node.client();
		
		
		
		
		if(client==null){
			client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(SysParameters.ESHOST, 9300));
		}
		return client;
	}
}
